package com.hxzy.controller.storehouse;

import com.github.pagehelper.PageInfo;
import com.hxzy.common.BaseServlet;
import com.hxzy.dto.storehouseDTO;
import com.hxzy.entity.storehouse;
import com.hxzy.service.impl.storehouseServiceIpml;
import com.hxzy.service.storehouseService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @Description:
 * @Author: YangYong
 * @Date: 2022/3/8 20:48
 */
@WebServlet(urlPatterns = "/storehouse/findall")
public class storehouse_selectByAll extends BaseServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.startPage(req);
        try {
            //2、收集参数
            storehouseDTO storehouseDTO = super.CollectiongParameterVlues(req, storehouseDTO.class);
            //3、查询数据
            storehouseService storehouseService=new storehouseServiceIpml();
            List<storehouse> all = storehouseService.findAll(storehouseDTO);

            //返回给客户端
            super.render(resp,new PageInfo(all));

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
